import request from '@/router/axios'

// 调拨单分页列表
export function allocationFetchList (query) {
  return request({
    url: '/eims/allocation/page',
    method: 'get',
    params: query
  })
}

// 调拨单分页列表
export function getGoodsQuantitySum (query) {
  return request({
    url: '/eims/allocation/getAllocationGoodsNumberSum',
    method: 'post',
    data: query
  })
}

// 新增调拨单
export function allocationAdd (obj) {
  return request({
    url: '/eims/allocation/saveAllocation',
    method: 'post',
    data: obj
  })
}

// 调拨订单修改
export function allocationEdit (obj) {
  return request({
    url: '/eims/allocation/updateAllocation',
    method: 'put',
    data: obj
  })
}

// 调拨订单删除
export function allocationDel (id) {
  return request({
    url: '/eims/allocation/'+id,
    method: 'delete'
  })
}

// 通过ID查询调拨单
export function allocationGetObj (id) {
  return request({
    url: '/eims/allocation/' + id,
    method: 'get'
  })
}

// 查询商品信息列表
export function storageFetchList (query) {
  return request({
    url: '/eims/storage/page',
    method: 'get',
    params: query
  })
}

// 商品调拨单详细商品信息
export function allDetailFetchList (query) {
  return request({
    url: '/eims/allDetail/list',
    method: 'get',
    params: query
  })
}

// 查询仓库列表
export function getStockFetchList(query) {
  return request({
    url: '/eims/stock/page',
    method: 'get',
    params: query
  })
}

//  调拨单收货
export function receiveAllocation(obj) {
  return request({
    url: '/eims/allocation/receiveAllocation',
    method: 'put',
    data: obj
  })
}

//  根据调拨单查询商品信息
export function getGoodsInfoByIdAndOutStockId(id,outStockId){
  return request({
    url: '/eims/allocation/' + id + '/' + outStockId,
    method: 'get'
  })
}
